package top.lshaci.learning.dubbo.consumer;

import org.apache.dubbo.config.annotation.Reference;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import top.lshaci.learning.dubbo.provider.service.HelloService;

@SpringBootApplication
public class ConsumerApplication {

	public static void main(String[] args)  {
		SpringApplication.run(ConsumerApplication.class, args);
	}

	@RestController
	static class TestController {

		@Reference
		HelloService helloService;

		@GetMapping("/test")
		public String test(String name) {
			return helloService.hello(name);
		}
	}
}
